/*
*    Phantom v2.0 GUI Automation Software
*    Copyright (C) 2009  John C. Van Arsdall (john@phantomtest.com)
*
*    This program is free software; you can redistribute it and/or modify
*    it under the terms of the GNU General Public License as published by
*    the Free Software Foundation; either version 2 of the License, or
*    (at your option) any later version.
*
*    This program is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License along
*    with this program; if not, write to the Free Software Foundation, Inc.,
*    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#pragma once
#include "SSI_ScriptAPI.h"

class CDataRegKey :
	public CData
{
public:
	CDataRegKey(void);
	~CDataRegKey(void);

// Pure Virtual Functions:
private:
	virtual SSI_BOOL CopyData(CData* Other);
	virtual CData* MakeData(void);
public:
	virtual SSI_BOOL DeleteData(CData* In);
	virtual SSI_BOOL DataFromString(const String& sData);
	virtual String GetString();
  virtual SSI_INT64 SizeOf();
	virtual SSI_INT64 Register(SSI_INT64 NewType);
	virtual void UnRegister();
	virtual CData* operator_equal(CData* InData, OpInfoT* Info = SSI_NULL);
private:
	// CONSIDER USING STD_OFILE_STREAM for CDataFile
	// FILE* Data;
	static SSI_INT64 sType;

	SSI_INT64 OpenState;
	HKEY Handle;
	//String Parent;
	String Path;
  String KeyDelim;

public:
	static SSI_INT64 GetRegisteredType(void);
	
	virtual void SSI_FunctionProcessor(SSI_FunctionAPI& theAPI);
	virtual CStatus SSI_UpdateVariable(CVariable& aVar, SSI_BOOL bGet);
	virtual CStatus InitData(void);

	SSI_INT64 Open(void);
	SSI_INT64 Close(void);
	String GetValues(String& NameDelim, String& ValueDelim);
	SSI_INT64 GetValueCount();
  String ValueFromType(DWORD Type, BYTE* In);
	
};
